<main class="app-content">
    <div class="row">
        <div class="col-md-12">
            <div class="tile">
                <div class="tile-body">
                    <form class="row">
                        <div class="form-group col-md-2">
                            <label class="control-label" for="select_org_id_search">组织机构</label>
                            <select class="form-control" title="机构组构" id="select_org_id_search">
                            </select>
                        </div>
                        <div class="form-group col-md-2">
                            <label class="control-label" for="key_word">关键词</label>
                            <input class="form-control" type="text" id="key_word" placeholder="检索关键词">
                        </div>
                        <div class="form-group col-md-2">
                            <label class="control-label" for="check_mod">检索模式</label>
                            <select class="form-control" id="check_mod">
                                <option value="">--检索模式--</option>
                                <option value="title">title</option>
                                <option value="body">body</option>
                                <option value="self">自定义</option>
                            </select>
                        </div>
                        <div class="form-group col-md-2">
                            <label class="control-label" for="search_time">最后检索日期</label>
                            <input class="form-control" type="text" id="search_time" placeholder="2020-01-01">
                        </div>
                        <div class="form-group col-md-4 align-self-end">
                            <button class="btn btn-primary" type="button" id="search"><i
                                    class="fa fa-fw fa-lg fa-search"></i>搜索
                            </button>
                            <button class="btn btn-primary" type="button" id="create_key_word"><i
                                    class="fa fa-plus"></i>API搜索
                            </button>
                            <button class="btn btn-primary" type="button" id="create_key_word_task"><i
                                    class="fa fa-fighter-jet"></i>XScan
                            </button>
                        </div>
                    </form>
                </div>
            </div>
            <div class="tile">
                <div class="tile-body">
                    <table class="table table-hover table-bordered" id="key_word_table" width="100%">
                    </table>
                </div>

                <!-------add-task-body---->
                <div class="modal fade" id="new_key_word_task" tabindex="-1" role="dialog"
                     aria-labelledby="myModalLabel"
                     aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header card-header bg-primary">
                                <h4 class="modal-title">
                                    新建XScan任务
                                    <i class="fa fa-question-circle"
                                       aria-hidden="true"
                                       title="Xscan任务是一个综合性的任务&#10;任务可以通过指定组织关联的FOFA语法，通过接口收集资产，然后自动化执行端口扫描，进行指纹识别、漏洞扫描。"></i>
                                </h4>
                            </div>
                            <div class="modal-body ">
                                <form class="form-horizontal" role="form">
                                    <div class="form-group">
                                        <div class="form-group row bg-lght">
                                            <div class="col-md-12">
                                                <div>
                                                    <div class="form-group row bg-light">
                                                        <div class="col-md-12">
                                                            <label for="select_org_id_task_xscan"><b><span
                                                                    class="text-danger">*</span>组织</b></label>
                                                            <select class="form-control"
                                                                    id="select_org_id_task_xscan">
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div>
                                                    <div class="form-group row">
                                                        <div class="col-md-12">
                                                            <label for="checkbox_fingerpint_xscan">
                                                                <b><span class="text-danger">*</span>指纹识别</b>
                                                            </label>
                                                        </div>
                                                        <div class="col-md-12">
                                                            <div class="form-check form-check-inline">
                                                                <label class="form-check-label"
                                                                       for="checkbox_fingerpint_xscan">
                                                                    <input class="form-check-input"
                                                                           id="checkbox_fingerpint_xscan"
                                                                           type="checkbox">默认指纹识别<i
                                                                        class="fa fa-question-circle"
                                                                        aria-hidden="true"
                                                                        title="通过调用内置的指纹识别模块，对资产进行主动指纹扫描和识别；指纹识别技术选项在系统配置中"></i>
                                                                </label>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div>
                                                    <div class="form-group row">
                                                        <div class="col-md-12">
                                                            <label>
                                                                <b><span class="text-danger">*</span>漏洞扫描</b>
                                                            </label>
                                                        </div>
                                                        <div class="col-md-12">
                                                            <div class="bs-component">
                                                                <ul class="nav nav-tabs"
                                                                    id="nav_tabs_xscan_pocscan">
                                                                    <li class="nav-item"><a class="nav-link active"
                                                                                            data-toggle="tab"
                                                                                            href="#nav_pocscan_xray"
                                                                                            title="对IP或Domain进行XScan扫描"><strong>Xray</strong></a>
                                                                    </li>
                                                                    <li class="nav-item"><a class="nav-link"
                                                                                            data-toggle="tab"
                                                                                            href="#nav_pocscan_nuclei"
                                                                                            title="对数据库中已存在的的组织资产进行XScan扫描"><strong>Nuclei</strong></a>
                                                                    </li>
                                                                    </li>
                                                                    <li class="nav-item"><a class="nav-link"
                                                                                            data-toggle="tab"
                                                                                            href="#nav_pocscan_goby"
                                                                                            title="对数据库中已存在的的组织资产进行XScan扫描"><strong>Goby</strong></a>
                                                                    </li>
                                                                </ul>
                                                                <div class="tab-content"
                                                                     id="myTabContentXscanPocscan">
                                                                    <div class="tab-pane fade active show"
                                                                         id="nav_pocscan_xray">
                                                                        <div class="col-md-12">
                                                                            <div class="form-check form-check-inline">
                                                                                <label class="form-check-label"
                                                                                       for="checkbox_xraypoc_xscan">
                                                                                    <input class="form-check-input"
                                                                                           id="checkbox_xraypoc_xscan"
                                                                                           type="checkbox">Xray<i
                                                                                        class="fa fa-question-circle"
                                                                                        aria-hidden="true"
                                                                                        title="通过调用xray，对获得的ip资产和域名资产进行漏洞验证；可以指定单个POC文件，或者*think*类的通配符；如果不选择poc文件，将使用全部poc进行测试。"></i>
                                                                                </label>
                                                                            </div>
                                                                            <br/>
                                                                            <label class="col-form-label"
                                                                                   for="select_xray_poc_type_xscan">
                                                                                Poc类型
                                                                            </label>
                                                                            <select class="form-control"
                                                                                    id="select_xray_poc_type_xscan">
                                                                                <option value="default">
                                                                                    默认的内置Poc
                                                                                </option>
                                                                                <option value="custom">
                                                                                    自定义Poc文件
                                                                                </option>
                                                                            </select>
                                                                            <label class="col-form-label"
                                                                                   for="input_xray_poc_file_xscan">
                                                                                Poc文件
                                                                            </label>
                                                                            <input class="form-control"
                                                                                   id="input_xray_poc_file_xscan"
                                                                                   type="text"
                                                                                   placeholder="--全部--" value=""
                                                                                   list="datalist_xray_poc_file_xscan">
                                                                            <datalist
                                                                                    id="datalist_xray_poc_file_xscan"
                                                                                    style="display:none;">
                                                                            </datalist>
                                                                        </div>

                                                                    </div>
                                                                    <div class="tab-pane fade"
                                                                         id="nav_pocscan_nuclei">
                                                                        <div class="col-md-12 col-form-label">
                                                                            <div class="form-check form-check-inline">
                                                                                <label class="form-check-label"
                                                                                       for="checkbox_nucleipoc_xscan">
                                                                                    <input class="form-check-input"
                                                                                           id="checkbox_nucleipoc_xscan"
                                                                                           type="checkbox">Nuclei<i
                                                                                        class="fa fa-question-circle"
                                                                                        aria-hidden="true"
                                                                                        title="通过调用Nuclei，对获得的ip资产和域名资产进行漏洞验证；可以指定单个POC文件，或者*think*类的通配符；如果不选择poc文件，将使用全部poc进行测试。(Nuclei目前存在5000+漏洞，扫描十分缓慢，大规模扫描请谨慎使用该漏洞扫描技术)"></i>
                                                                                </label>
                                                                            </div>
                                                                            <br/>
                                                                            <label class="col-form-label"
                                                                                   for="input_nuclei_poc_file_xscan">
                                                                                Poc文件
                                                                            </label>
                                                                            <input class="form-control"
                                                                                   id="input_nuclei_poc_file_xscan"
                                                                                   type="text"
                                                                                   placeholder="--全部--" value=""
                                                                                   list="datalist_nuclei_poc_file_xscan">
                                                                            <datalist
                                                                                    id="datalist_nuclei_poc_file_xscan"
                                                                                    style="display:none;">
                                                                            </datalist>
                                                                        </div>
                                                                    </div>
                                                                    <div class="tab-pane fade"
                                                                         id="nav_pocscan_goby">
                                                                        <div class="col-md-12 col-form-label">
                                                                            <div class="form-check form-check-inline">
                                                                                <label class="form-check-label"
                                                                                       for="checkbox_gobypoc_xscan">
                                                                                    <input class="form-check-input"
                                                                                           id="checkbox_gobypoc_xscan"
                                                                                           type="checkbox">Goby<i
                                                                                        class="fa fa-question-circle"
                                                                                        aria-hidden="true"
                                                                                        title="通过调用Goby，对获得的ip资产和域名资产进行漏洞验证；goby需要部署到服务端以goby-cmd方将启动，将在worker.yml中配置；将使用全部poc进行测试。"></i>
                                                                                </label>
                                                                            </div>
                                                                            <br/>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>

                                                <div class="form-group row">
                                                    <div class="col-md-12">
                                                        <div class="form-check form-check-inline">
                                                            <label class="form-check-label"
                                                                   for="checkbox_cron_task_xscan">
                                                                <input class="form-check-input"
                                                                       id="checkbox_cron_task_xscan" type="checkbox"
                                                                ><b>定时任务</b><i
                                                                    class="fa fa-info-circle" aria-hidden="true"
                                                                    title="定时任务&#10;任务在指定时间启动并周期执行，执行规则同Linux Crontab任务计划格式&#10;任务格式：“分钟 小时 日 月 周”，可使用*、/、,、-等特殊符号&#10;例：0 8-16/2 * * *表示在每天8-16点的整点，每隔2小时启动&#10;参见：https://www.runoob.com/w3cnote/linux-crontab-tasks.html"></i>
                                                            </label>
                                                        </div>
                                                        <input class="form-control" id="input_cron_comment_xscan"
                                                               type="text"
                                                               placeholder="定时任务简要说明" disabled
                                                               value="">
                                                        <div class="form-check form-check-inline">
                                                            <label class="form-check-label" id="label_cron_rule_xscan"
                                                                   disabled
                                                                   for="input_cron_rule_xscan">
                                                                定时执行规则
                                                            </label>
                                                        </div>
                                                        <input class="form-control" id="input_cron_rule_xscan"
                                                               type="text"
                                                               placeholder="0 8 * * *" disabled value="0 8 * * *">
                                                    </div>
                                                </div>
                                                <div class="form-group row ">
                                                    <div class="col-md-12">
                                                        <div class="form-check form-check-inline">
                                                            <label class="form-check-label"
                                                                   for="checkbox_proxy_xscan">
                                                                <input class="form-check-input"
                                                                       id="checkbox_proxy_xscan" type="checkbox"
                                                                ><b>使用代理</b><i
                                                                    class="fa fa-info-circle" aria-hidden="true"
                                                                    title="worker使用配置的代理进行执行任务，代理的配置、支持代理的技术和工具见Config-配置管理-Worker代理配置"></i>
                                                            </label>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-secondary" data-dismiss="modal"
                                        aria-hidden="true">取消
                                </button>
                                <button class="btn btn-primary org-update" type="button"
                                        id="start_xscan_task">
                                    执行
                                </button>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal-dialog -->
                </div>


                <!----tile body-->
                <div class="modal fade" id="new_key_word" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                     aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header card-header bg-primary">
                                <h4 class="modal-title" id="keywordActionType">
                                    新建API搜索
                                </h4>
                            </div>
                            <div class="modal-body ">
                                <form class="form-horizontal" role="form">
                                    <div class="form-group">
                                        <div class="form-group row ">
                                            <div class="col-md-12">
                                                <label for="select_import_org_id_task"><b><span
                                                        class="text-danger">*</span>归属组织</b></label>
                                                <select class="form-control"
                                                        id="select_import_org_id_task">
                                                </select>
                                                <label for="add_key_word">
                                                    <b><span class="text-danger">*</span>关键词或语法</b>
                                                </label>
                                                <textarea class="form-control" id="add_key_word" rows="2"
                                                          placeholder='需要采集的关键词，以||分隔，如：xx公司||xxx系统；或者自定义的搜索语法，如：icon_hash="12345678" || body="12306.cn"'></textarea>
                                                <label for="add_exclude_words">过滤词组
                                                </label>
                                                <textarea class="form-control" id="add_exclude_words" rows="4"
                                                          placeholder="对该关键词需要反向过滤的词组，以||分隔，如想检索“中国银行”关键词，需要过滤”中国银行保险监督“，”中国银行卡“等非目标词，即填:中国银行保险监督||中国银行卡"></textarea>
                                                <div class=" form-check-inline">
                                                    <label class="form-check-label" for="add_search_time">检索日期
                                                    </label>
                                                </div>
                                                <input class="form-control" id="add_search_time" type="text"
                                                       placeholder="检索日期，如:2020-01-01" value="">
                                                <label class="form-check-label" for="add_check_mod">检索模式
                                                </label>
                                                <select class="form-control" id="add_check_mod">
                                                    <option value="title">title</option>
                                                    <option value="body">body</option>
                                                    <option value="self">自定义的语法</option>
                                                </select>
                                                <label class="form-check-label"
                                                       for="add_count">
                                                    检索数量
                                                </label>
                                                <input class="form-control" id="add_count" type="text"
                                                       placeholder="关键词单次检索数量" value="100">
                                                </br>
                                                <div class="form-group row">
                                                    <div class="col-md-12">
                                                        <div class="form-check form-check-inline">
                                                            <label class="form-check-label"
                                                                   for="checkbox_fofasearch">
                                                                <input class="form-check-input"
                                                                       id="checkbox_fofasearch"
                                                                       type="checkbox"><b>Fofa</b><i
                                                                    class="fa fa-info-circle" aria-hidden="true"
                                                                    title="调用FOFA API接口查询，需在worker.yml中配置KEY"></i>
                                                            </label>
                                                        </div>
                                                        <div class="form-check form-check-inline">
                                                            <label class="form-check-label"
                                                                   for="checkbox_quakesearch">
                                                                <input class="form-check-input"
                                                                       id="checkbox_quakesearch"
                                                                       type="checkbox"><b>Quake</b><i
                                                                    class="fa fa-info-circle" aria-hidden="true"
                                                                    title="调用Quake API接口查询，需在worker.yml中配置KEY"></i>
                                                            </label>
                                                        </div>
                                                        <div class="form-check form-check-inline">
                                                            <label class="form-check-label"
                                                                   for="checkbox_huntersearch">
                                                                <input class="form-check-input"
                                                                       id="checkbox_huntersearch"
                                                                       type="checkbox"><b>Hunter</b><i
                                                                    class="fa fa-info-circle" aria-hidden="true"
                                                                    title="调用Hunter API接口查询，需在worker.yml中配置KEY"></i>
                                                            </label>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="modal-footer">
                                <input type="hidden" id="key_word_id" value="0"/>
                                <button type="button" class="btn btn-secondary" data-dismiss="modal"
                                        aria-hidden="true">取消
                                </button>
                                <button class="btn btn-primary org-update" type="button" id="start_add_key_search_word">
                                    保存
                                </button>
                            </div>
                        </div><!-- /.modal-content -->
                    </div><!-- /.modal-dialog -->
                </div> <!-- table responsive-->
            </div> <!-- tile -->
        </div> <!-- col md-12 -->
    </div>
    <!--row-->
</main>
<script src="static/js/jquery/jquery-3.3.1.min.js"></script>
<script src="static/js/bootstrap/popper.min.js"></script>
<script src="static/js/bootstrap/bootstrap.min.js"></script>
<script src="static/js/main.js"></script>
<script src="static/js/plugins/pace.min.js"></script>
<!-- Data table plugin-->
<script src="static/js/plugins/jquery.dataTables.min.js"></script>
<script src="static/js/plugins/dataTables.bootstrap.min.js"></script>
<script src="static/js/sweetalert/sweetalert.min.js"></script>
<script src="static/js/jquery/jquery.bootstrap-duallistbox.js"></script>
<script src="static/js/server/key-word-list.js"></script>
<script src="static/js/server/assert-list.js"></script>
<script>
    $(function () {
        $("title").html("OnlineAPISearch-Nemo");
    });
</script>